from django.db import models

# Create your models here.
from django.utils import timezone


class Today(models.Model):
    """今日推荐"""
    title=models.CharField(max_length=50,verbose_name='标题')
    content=models.TextField()

    class Meta:
        db_table = 'tb_Today'
        verbose_name = '今日推荐'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.title


class EverydaySentence(models.Model):
    """每日一句"""
    date=models.DateField(default=timezone.now)
    content=models.TextField()
    content2=models.TextField()
    class Meta:
        db_table = 'tb_EverydaySentence'
        verbose_name = '每日一句'
        verbose_name_plural = verbose_name

    def __str__(self):
        return  self.date+"每日一句"


class Notification(models.Model):
    '''主页通知'''
    content=models.TextField()
    date = models.DateTimeField(null=True, verbose_name='发布日期',auto_now=True)

    class Meta:
        db_table = 'tb_Notification'
        verbose_name = '通告'
        verbose_name_plural = verbose_name

    def __str__(self):
        return  self.content


